﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BISPOS.Repository
{
    public class EmployeeRepository
    {
        BISPOSDataClassesDataContext db = new BISPOSDataClassesDataContext();
        public Employee GetEmployee(int id) { return db.Employees.FirstOrDefault(x => x.Id == id); }
        public void EditEmployee(int id, string name, string nationalId,
            string address, string telephone, string userName, string passWord)
        {
            Employee employee = GetEmployee(id);
            employee.Name = name;
            employee.NationalId = nationalId;
            employee.Address = address;
            employee.Telephone = telephone;
            employee.UserName = userName;
            employee.PassWord = passWord;
            Save();

        }
        public void Save() { db.SubmitChanges(); }
    }
}
